//
//  CTVIntroOverlayController.m
//  Channltv
//
//  Created by Bruno Keymolen on 13/11/07.
//  Copyright 2007 channl.tv. All rights reserved.
//

#import "CTVIntroOverlayController.h"


@implementation CTVIntroOverlayController

-(id)initWithScene:(BRRenderScene *)scene andTitle:(NSString*)title{
	self = [super initWithScene:scene];


	m_titlecontrol = [[BRTextControl alloc] initWithScene: scene];
	[m_titlecontrol setText:title];
	[m_titlecontrol setTextAttributes:[[BRThemeInfo sharedTheme] menuItemTextAttributes]];
	

	[self addControl:m_titlecontrol];

	[self _layout];

	return self;
}


-(void)dealloc{

	[m_titlecontrol release];
	
	[super dealloc];
}


-(BOOL)brEventAction:(BREvent*)event{
	
	//We are only interested in the key-down events.
	if([event value] == 0){
		return [super brEventAction:event];
	}

	return [super brEventAction:event];
}



//Private
-(void)_layout{
	NSRect masterFrame = [[self masterLayer] frame];
	NSRect titleframe = masterFrame;    	
	
	titleframe.size.height = masterFrame.size.height * 0.20f;

	[m_titlecontrol setFrame:titleframe];
}


@end
